'''
隐式等待
显式等待
sleep死等
'''

from kyb_caps import driver,By,webdriver,sleep

#1隐式等待
from selenium.webdriver.support.wait import WebDriverWait
#2显示等待
from selenium.webdriver.support import expected_conditions as EC
#方法一
# resgister_btn_loc=(By.ID,'com.tal.kaoyan:id/login_register_text')
# WebDriverWait(driver,30,0.5).until(EC.presence_of_element_located(resgister_btn_loc))
# ele=WebDriverWait(driver,30,0.5).until(EC.visibility_of_element_located(resgister_btn_loc))
# ele.click()
# sleep(3)

#方法二
resgister_btn_loc=(By.ID,'com.tal.kaoyan:id/login_register_text')
ele=WebDriverWait(driver,30,0.5).until(lambda x: x.find_element(By.ID, 'com.tal.kaoyan:id/login_register_text'))
ele.click()

#方法三
sleep(3)

driver.quit()